package your.rfgui.application.data;

import your.rfgui.extgui.data.intf.DataItem;
import your.rfgui.extgui.data.intf.GuiBaseEntity;

/**
 *
 */
public abstract class CommonBaseEntity implements GuiBaseEntity, DataItem {

   protected Long id;

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   /**
    * Whether this item is identical (equal) to the given entity
    */
   @Override
   public boolean identical(DataItem other) {
      //if (!PersistenceMngr.identicalClass(this, other)) {
      if (other == null || this.getClass() != other.getClass()) {
         return false;
      }
      return this.getId().equals(((CommonBaseEntity) other).getId());
   }

   @Override
   public String toString() {
      return getLabel();
   }
}
